<%-- 
    Document   : ConsulteAbsence
    Created on : 4 déc. 2013, 18:12:48
    Author     : Frantz
--%>
<%@page import="java.util.StringTokenizer"%>
<%@page import="java.sql.Date"%>
<%@page import="Objet.Absence"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Objet.Secretaire"%>
<%@page import="java.util.Iterator"%>
<%@page import="Objet.Module"%>
<%@page import="Objet.Enseignant"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Consultation_Absence</title>
    </head>
    <body>
        
        <jsp:useBean id="co" scope="request" class="Objet.QueryBD"/>
        <jsp:useBean id="FormSec" scope="request" class="Form.SecretaireForm"/>
        <jsp:useBean id="monAuth" scope="request" class="Form.FirstActionForm"/>
         
        
              <%/*
                
                Iterator<Absence> monIt = (monSecretaire.getList()).iterator();
                   while(monIt.hasNext())
                    {
                        Module ModCour = monIt.next();
                        out.println("<tr><td>" +  ModCour.getModule()
                                +"</td><td>"+  ModCour.getLibellé());
                    }
                
            */%>
            
 
                     

        <form method="POST" action="UpdateActionForm.do">
            <center><h1>Les Absences</h1>
            <table border ="1">
                <tr>
                    <th>Nom etudiant</th>
                    <th>Prenom etudiant</th>
                    
                    <th>Nom enseignant</th>
                    <th>module</th>
                    <th>n°promotion</th>

                    
                    <th>date creneau</th>
                    <th>heure debut</th>
                    <th>heure fin</th>
                    <th>statut</th>
                </tr>
            <%
                ArrayList<Absence> ListAbsence = 
                        new ArrayList(co.lesAbsences());
                
                Iterator<Absence> monIt = ListAbsence.iterator();
                int i=1;
                int id_etu;
                String nom_etu;
                String prenom_etu;
                int id_ens;
                String nom_ens;
                String prenom_ens;
                int id_abs;
                String module;
                Date d;
                String Heure_debut;
                String Heure_fin;
                String statut;
                String chaine_tk;
                
             
                while(monIt.hasNext())
                    {
                        Absence UneAbsence = monIt.next();
                        
                        id_etu = UneAbsence.getId_etu();
                        nom_etu = co.nomEtudiant(id_etu);
                        prenom_etu = co.prenomEtudiant(id_etu);
                        id_ens = UneAbsence.getNumen();
                        nom_ens = co.nomEnseignant(id_ens);
                        id_abs = UneAbsence.getId_absence();
                        module = UneAbsence.getModule();
                        d = UneAbsence.getD();
                        Heure_debut = UneAbsence.getDebut();
                        Heure_fin = UneAbsence.getFin();
                        statut = UneAbsence.getStatut();
                        
                        %>
                        <tr>
                                <td>
                                     <% out.println(nom_etu.toString()); %> 
 
                                </td>
                                
                                <td> 
                                    <% out.println(prenom_etu.toString()); %>  
                                </td>

                                <td>   
                                    <% out.println(nom_ens.toString()); %>
                                </td>
                                <% StringTokenizer tk = new StringTokenizer(module,"_");
                                while(tk.hasMoreTokens()){ 
                                        chaine_tk=tk.nextToken(); %>
                                        <td>       
                                        <% out.println(chaine_tk);%>
                                        <% // out.println("tk.nextToken('_')"); %>
                                        </td>
                                <% } %> 
                       
                                <!--td>
                                    <% //out.println(module.toString()); %> 
                                </td-->
                                <td>
                                    <% out.println(d.toString()); %>     
                                </td>
                                <td>
                                    <% out.println(Heure_debut.toString()); %> 
                                </td>
                                <td>
                                    <% out.println(Heure_fin.toString()); %>
                                </td>
                                <td>
                                    <% out.println(statut.toString()); %>
                                </td>           
                    <% } %>

            </table>
            </center>
        </form>
              
    </body>
</html>

